.class Lcom/xiaomi/notes/NoteListActivity$4;
.super Ljava/lang/Object;
.source "NoteListActivity.java"

# interfaces
.implements Landroid/view/View$OnTouchListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/xiaomi/notes/NoteListActivity;->initListener()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/xiaomi/notes/NoteListActivity;


# direct methods
.method constructor <init>(Lcom/xiaomi/notes/NoteListActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 479
    iput-object p1, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onTouch(Landroid/view/View;Landroid/view/MotionEvent;)Z
    .locals 14
    .parameter "v"
    .parameter "event"

    .prologue
    const/4 v13, 0x0

    .line 482
    invoke-virtual/range {p2 .. p2}, Landroid/view/MotionEvent;->getAction()I

    move-result v9

    packed-switch v9, :pswitch_data_0

    .line 531
    :cond_0
    :goto_0
    return v13

    .line 484
    :pswitch_0
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$400(Lcom/xiaomi/notes/NoteListActivity;)Lcom/xiaomi/notes/DragView;

    move-result-object v9

    if-eqz v9, :cond_0

    .line 485
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$000(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v9

    packed-switch v9, :pswitch_data_1

    .line 506
    :cond_1
    :goto_1
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    iget-object v10, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v10}, Lcom/xiaomi/notes/NoteListActivity;->access$100(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v10

    invoke-virtual {v9, v10}, Lcom/xiaomi/notes/NoteListActivity;->synDB(I)V

    .line 507
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$400(Lcom/xiaomi/notes/NoteListActivity;)Lcom/xiaomi/notes/DragView;

    move-result-object v9

    invoke-virtual {v9}, Lcom/xiaomi/notes/DragView;->hide()V

    .line 508
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    const/4 v10, 0x0

    invoke-static {v9, v10}, Lcom/xiaomi/notes/NoteListActivity;->access$402(Lcom/xiaomi/notes/NoteListActivity;Lcom/xiaomi/notes/DragView;)Lcom/xiaomi/notes/DragView;

    goto :goto_0

    .line 487
    :pswitch_1
    move-object v0, p1

    check-cast v0, Landroid/widget/ListView;

    move-object v9, v0

    invoke-virtual {v9}, Landroid/widget/ListView;->getChildCount()I

    move-result v2

    .line 488
    .local v2, count:I
    new-instance v3, Landroid/graphics/Rect;

    invoke-direct {v3}, Landroid/graphics/Rect;-><init>()V

    .line 489
    .local v3, frame:Landroid/graphics/Rect;
    const/4 v4, 0x0

    .local v4, i:I
    :goto_2
    if-ge v4, v2, :cond_1

    .line 490
    move-object v0, p1

    check-cast v0, Landroid/widget/ListView;

    move-object v9, v0

    invoke-virtual {v9, v4}, Landroid/widget/ListView;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    .line 491
    .local v1, child:Landroid/view/View;
    invoke-virtual {v1, v3}, Landroid/view/View;->getHitRect(Landroid/graphics/Rect;)V

    .line 492
    invoke-virtual/range {p2 .. p2}, Landroid/view/MotionEvent;->getRawX()F

    move-result v9

    float-to-int v9, v9

    invoke-virtual/range {p2 .. p2}, Landroid/view/MotionEvent;->getRawY()F

    move-result v10

    float-to-int v10, v10

    iget-object v11, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v11}, Lcom/xiaomi/notes/NoteListActivity;->access$300(Lcom/xiaomi/notes/NoteListActivity;)Landroid/widget/ListView;

    move-result-object v11

    invoke-virtual {v11}, Landroid/widget/ListView;->getTop()I

    move-result v11

    sub-int/2addr v10, v11

    invoke-virtual {v3, v9, v10}, Landroid/graphics/Rect;->contains(II)Z

    move-result v9

    if-eqz v9, :cond_2

    .line 495
    move-object v0, p1

    check-cast v0, Landroid/widget/ListView;

    move-object v9, v0

    invoke-virtual {v9}, Landroid/widget/ListView;->getAdapter()Landroid/widget/ListAdapter;

    move-result-object v9

    invoke-interface {v9, v4}, Landroid/widget/ListAdapter;->getItemId(I)J

    move-result-wide v5

    .line 496
    .local v5, id:J
    long-to-int v9, v5

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->isFolder(I)Z

    move-result v9

    if-eqz v9, :cond_2

    .line 497
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$800(Lcom/xiaomi/notes/NoteListActivity;)Lcom/xiaomi/notes/DBOperate;

    move-result-object v9

    iget-object v10, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v10}, Lcom/xiaomi/notes/NoteListActivity;->access$400(Lcom/xiaomi/notes/NoteListActivity;)Lcom/xiaomi/notes/DragView;

    move-result-object v10

    invoke-virtual {v10}, Lcom/xiaomi/notes/DragView;->getId()J

    move-result-wide v10

    long-to-int v12, v5

    invoke-static {v12}, Lcom/xiaomi/notes/NoteListActivity;->getFolderIdFromDBID(I)I

    move-result v12

    invoke-virtual {v9, v10, v11, v12}, Lcom/xiaomi/notes/DBOperate;->updateNote(JI)V

    goto :goto_1

    .line 489
    .end local v5           #id:J
    :cond_2
    add-int/lit8 v4, v4, 0x1

    goto :goto_2

    .line 512
    .end local v1           #child:Landroid/view/View;
    .end local v2           #count:I
    .end local v3           #frame:Landroid/graphics/Rect;
    .end local v4           #i:I
    :pswitch_2
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$400(Lcom/xiaomi/notes/NoteListActivity;)Lcom/xiaomi/notes/DragView;

    move-result-object v9

    if-eqz v9, :cond_0

    .line 513
    invoke-virtual/range {p2 .. p2}, Landroid/view/MotionEvent;->getRawX()F

    move-result v9

    float-to-int v7, v9

    .line 514
    .local v7, x:I
    invoke-virtual/range {p2 .. p2}, Landroid/view/MotionEvent;->getRawY()F

    move-result v9

    float-to-int v8, v9

    .line 516
    .local v8, y:I
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$400(Lcom/xiaomi/notes/NoteListActivity;)Lcom/xiaomi/notes/DragView;

    move-result-object v9

    invoke-virtual {v9, v7, v8}, Lcom/xiaomi/notes/DragView;->setPosition(II)V

    .line 518
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$700(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v9

    iget-object v10, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v10}, Lcom/xiaomi/notes/NoteListActivity;->access$600(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v10

    if-eq v9, v10, :cond_0

    .line 519
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    iget-object v10, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v10}, Lcom/xiaomi/notes/NoteListActivity;->access$900(Lcom/xiaomi/notes/NoteListActivity;)Landroid/util/DisplayMetrics;

    move-result-object v10

    iget v10, v10, Landroid/util/DisplayMetrics;->heightPixels:I

    div-int/lit8 v10, v10, 0x2

    sub-int/2addr v10, v8

    div-int/lit8 v10, v10, 0x14

    invoke-static {v9, v10}, Lcom/xiaomi/notes/NoteListActivity;->access$512(Lcom/xiaomi/notes/NoteListActivity;I)I

    .line 520
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$500(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v9

    iget-object v10, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v10}, Lcom/xiaomi/notes/NoteListActivity;->access$600(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v10

    if-ge v9, v10, :cond_3

    .line 521
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    iget-object v10, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v10}, Lcom/xiaomi/notes/NoteListActivity;->access$600(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v10

    invoke-static {v9, v10}, Lcom/xiaomi/notes/NoteListActivity;->access$502(Lcom/xiaomi/notes/NoteListActivity;I)I

    .line 523
    :cond_3
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$500(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v9

    iget-object v10, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v10}, Lcom/xiaomi/notes/NoteListActivity;->access$700(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v10

    if-le v9, v10, :cond_4

    .line 524
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    iget-object v10, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v10}, Lcom/xiaomi/notes/NoteListActivity;->access$700(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v10

    invoke-static {v9, v10}, Lcom/xiaomi/notes/NoteListActivity;->access$502(Lcom/xiaomi/notes/NoteListActivity;I)I

    .line 526
    :cond_4
    iget-object v9, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v9}, Lcom/xiaomi/notes/NoteListActivity;->access$300(Lcom/xiaomi/notes/NoteListActivity;)Landroid/widget/ListView;

    move-result-object v9

    iget-object v10, p0, Lcom/xiaomi/notes/NoteListActivity$4;->this$0:Lcom/xiaomi/notes/NoteListActivity;

    invoke-static {v10}, Lcom/xiaomi/notes/NoteListActivity;->access$500(Lcom/xiaomi/notes/NoteListActivity;)I

    move-result v10

    invoke-virtual {v9, v13, v10}, Landroid/widget/ListView;->setSelectionFromTop(II)V

    goto/16 :goto_0

    .line 482
    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_2
    .end packed-switch

    .line 485
    :pswitch_data_1
    .packed-switch 0x0
        :pswitch_1
    .end packed-switch
.end method
